package com.sccba.uop.demo.common.constant;

public enum ResponseHeaderField {
    X_UOP_UNIQUE_NO("X-Uop-Unique-No"),
    X_UOP_SIGNATURE("X-Uop-Signature"),
    X_UOP_ENCRYPTED_KEY("X-Uop-Encrypted-Key");

    //X_UOP_UNIQUE_NO("x-uop-unique-no"),
    //X_UOP_SIGNATURE("x-uop-signature"),
    //X_UOP_ENCRYPTED_KEY("x-uop-encrypted-key");

    private final String name;

    ResponseHeaderField(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public ResponseHeaderField from(String val) {
        ResponseHeaderField[] values = ResponseHeaderField.values();
        for (ResponseHeaderField value : values) {
            if (value.name.equals(val)) {
                return value;
            }
        }
        return null;
    }

    public boolean eq(String val) {
        if (val == null || "".equals(val)) {
            return false;
        }
        return this.name.equals(val);
    }
}
